package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IStrategyCommentService;
import cn.wolfcode.trip.base.service.IUserService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("strategyComment")
public class StrategyCommentController {
    @Autowired
    private IStrategyCommentService commentService;

    @RequestMapping("list")//主页面
    public String list(@ModelAttribute("qo")QueryObject qo, Model model){
        PageInfo<StrategyComment> result = commentService.query(qo);
        model.addAttribute("result",result);
        return "strategyComment/list";
    }
    @RequestMapping("saveOrUpdate")//更改状态
    @ResponseBody
    public Object saveOrUpdate(Long id,Long state){
        return commentService.updataState(id,state);
    }
}
